These tests all play nicely with Rust 1.16.
use std::fs::{self, File};
use std::io::prelude::*;
-use cargotest::{rustc_host, is_nightly, sleep_ms};
+use cargotest::{rustc_host, sleep_ms};
use cargotest::support::{project, execs};
use cargotest::support::paths::CargoPathExt;
use cargotest::support::registry::Package;
#[test]
fn panic_abort_with_build_scripts() {
- if !is_nightly() {
- return
- }
let p = project("foo")
.file("Cargo.toml", r#"
[project]
#[test]
fn panic_abort_compiles_with_panic_abort() {
- if !is_nightly() {
- return
- }
let p = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn compiler_json_error_format() {
- if !is_nightly() { return }
-
let p = project("foo")
.file("Cargo.toml", r#"
[project]
use std::fmt;
use cargo::util::{Cfg, CfgExpr};
-use cargotest::{is_nightly, rustc_host};
+use cargotest::rustc_host;
use cargotest::support::registry::Package;
use cargotest::support::{project, execs};
use hamcrest::assert_that;
#[test]
fn cfg_easy() {
- if !is_nightly() { return }
-
let p = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn dont_include() {
- if !is_nightly() { return }
-
let other_family = if cfg!(unix) {"windows"} else {"unix"};
let p = project("foo")
.file("Cargo.toml", &format!(r#"
#[test]
fn works_through_the_registry() {
- if !is_nightly() { return }
-
Package::new("foo", "0.1.0").publish();
Package::new("bar", "0.1.0")
.target_dep("foo", "0.1.0", "cfg(unix)")
#[test]
fn multiple_match_ok() {
- if !is_nightly() { return }
-
let p = project("foo")
.file("Cargo.toml", &format!(r#"
[package]
#[test]
fn any_ok() {
- if !is_nightly() { return }
-
let p = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn check_success() {
- if !is_nightly() {
- return
- }
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn check_fail() {
- if !is_nightly() {
- return
- }
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn check_build() {
- if !is_nightly() {
- return;
- }
-
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn build_check() {
- if !is_nightly() {
- return;
- }
-
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
// not built.
#[test]
fn issue_3418() {
- if !is_nightly() {
- return;
- }
-
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
// checked, but in this case with a proc macro too.
#[test]
fn issue_3419() {
- if !is_nightly() {
- return;
- }
-
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
// test `cargo rustc --profile check`
#[test]
fn rustc_check() {
- if !is_nightly() {
- return
- }
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn rustc_check_err() {
- if !is_nightly() {
- return
- }
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn check_all() {
- if !is_nightly() {
- return
- }
let foo = project("foo")
.file("Cargo.toml", r#"
[package]
use std::str;
use std::fs;
-use cargotest::{is_nightly, rustc_host};
+use cargotest::rustc_host;
use cargotest::support::{project, execs, path2url};
use cargotest::support::registry::Package;
use hamcrest::{assert_that, existing_file, existing_dir, is_not};
fn doc_target() {
const TARGET: &'static str = "arm-unknown-linux-gnueabihf";
- if !is_nightly() { return }
-
let p = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn test_panic_abort_with_dep() {
- if !is_nightly() {
- return
- }
let p = project("foo")
.file("Cargo.toml", r#"
[package]
#[test]
fn cfg_test_even_with_no_harness() {
- if !is_nightly() {
- return
- }
let p = project("foo")
.file("Cargo.toml", r#"
[package]